sauron
Sauron is an HTML web framework for building web-apps with the goal of closely adhering to The Elm Architecture, a paragon of elegant design.
Sauron follow Elm's simplistic design of writing view code.
Example
use *;
use *;
use *;
index.html
Minimal sauron app
In Cargo.toml, specify the crate-type to be cdylib
[]
= ["cdylib"]
Build using
Look at the examples and the build script for the details.
Demo examples
- todomvc
- data-viewer - A resizable spreadsheet CSV data viewer
- svg_clock - A clock drawn using SVG and window tick event.
- svg_graph - A simple graph using SVG
- tinki wiki - My personal wiki, powering my github pages
Converting HTML into Sauron's syntax
html2sauron - A tool to easily convert html into sauron node tree for your views.
Note: When writing the view in sauron, just keep in mind that the function name is the element tag you are creating and there is 2 arguments for it. The first argument is an array of the attributes of the element and the second argument is an array of the children of the element.
Example:
div!
div
macro call is the element tag.
The 1st argument in the call is an array of attributes for the div element expressed in a
function call id
and class
which are valid attributes for a div.
The 2nd argument in the call is an array of the children elements, and you can nest as many as
you like.
Prerequisite:
Performance:
Sauron is one of the fastest.
Run the benchmark yourself:
Please support this project:
License: MIT